import Mock from 'mockjs';
import { routerData } from './routerData';

// 登录
Mock.mock('http://127.0.0.1:5000/api/login', 'post', (req) => {
  let data = JSON.parse(req.body);
  if (data.username === 'admin' && data.password === '111') {
    return Mock.mock({
      code: 200,
      msg: '登录成功',
      data: {
        token: 'dhawjoldw',
        userInfo: {
          userName: '张三',
        },
        routerData,
      },
    });
  }
  return Mock.mock({
    code: 203,
    msg: 'err',
  });
});






